<div class="nav">
    <a href="{:U('index')}">配送方式列表</a>
    <a href="{:U('add')}">添加配送方式</a>
    <a href="{:U('takeself')}">自提点管理</a>
    <a class="sel" href="{:U('takeself_add')}">添加自提点</a>
</div>
<div class="add">
    <form method="post" action="" >
        <table class="table_add">
            <tr>
                <td width="100px">自提点名称</td>
                <td><input class="input1" type="text" name="name" id="name" value=""  style="width:180px" /></td>
            </tr>
            <tr>
                <td width="100px">所在地区：</td>
                <td><span id="span_province">
                        <select name="province" id="province" class="sel1">
                            <option value="">选择省份</option>
                            <foreach name="province" item="prov">
                                <option value="{$prov.province}">{$prov.province}</option>
                            </foreach>
                        </select>
                    </span>
                    <span id="span_city"></span>
                    <span id="span_area"></span>
                </td>
            </tr>
            <tr>
                <td width="100px">详细地址</td>
                <td><input class="input1" type="text" name="address" id="address" value=""  style="width:400px" /></td>
            </tr>
            <tr>
                <td width="100px">邮政编码</td>
                <td><input class="input1" type="text" name="zip" id="zip" value=""  style="width:100px" /></td>
            </tr>
            <tr>
                <td width="100px">电话</td>
                <td><input class="input1" type="text" name="tel" id="tel" value=""  style="width:180px" /></td>
            </tr>
            
            <tr>
                <td width="100px">手机</td>
                <td><input class="input1" type="text" name="phone" id="phone" value=""  style="width:180px" /></td>
            </tr>
            
            <tr>
                <td width="100px">是否启用</td>
                <td><select name="is_enable" id="is_enable" class="sel1">
                        <option value="1">启用</option>
                        <option value="0">不启用</option>
                    </select> &nbsp; &nbsp;  顺序编号：<input class="input1" type="text" name="order_id" id="order_id" value="1000" style="width:60px" />
                </td>
            </tr>
            <tr>
                <td></td>
                <td><input type="submit" class="btn1" value="提 交" /> &nbsp; <input class="btn4" type="reset" value="重 置" /> &nbsp; <input class="btn3"  type="button" onclick="window.history.back()" value="返 回" /></td>
            </tr>
        </table>
    </form>
    
    <script type="text/javascript">
      //用户地区选择
             $("#province").change(function() {
                    change_province();
             });

            function change_province() {
                var province = $("#province").val();
                $("#span_city").load("{:U('Address/city_sel')}?province=" + encodeURI(province) + "&city=");
                $("#span_area").html("");
            }

            function change_city() {
                var city = $("#city").val();
                $("#span_area").load("{:U('Address/area_sel')}?city=" + encodeURI(city) + "&area=");
            }

            function change_area() {
                var area = $("#area").val();
                $.get("{:U('Address/get_zip')}?area=" + encodeURI(area), function(zip) {
                    if (zip != '') {
                        $("#zip").val(zip);
                    }
                });
            }
        
    </script>
    
</div>
